<template>
  <div class="">
    <div
      class="navMarginTop allBackground analysis"
      :style="{ height: screenHeight - 120 + 'px', overflow: 'hidden auto' }"
    >
      <!-- <img class="banner" src="@assets/home.png" alt="" style="width: 100%" /> -->
      <div class="header-bgimg">
        <div class="top-model">
          <div class="top-title">
            <h6>AI创作平台</h6>
            <span>用AI提高10倍工作和企业营销效率</span>
          </div>
          <div class="title-list-block">
            <dl>
              <dt
                :class="[index === indexStyle ? 'active' : '']"
                v-for="(item, index) in systemData"
                :key="index"
                @mouseover="changePh(item, index)"
              >
                {{ item.title }}
              </dt>
            </dl>
          </div>
          <div class="computer-show">
            <img class="computer-one" src="https://txcdn.peiyinapp.com/images/aixz/diannao.png" alt="" />
            <img class="computer-img" :src="photoOnshow" alt="" />
          </div>
        </div>
      </div>
      <div class="modList">
        <div class="modListCot">
          <div class="dd">
            <div class="top">
              <img src="@assets/chat/duiihua.png" alt="" />
              <div class="right">
                <span>AI聊天</span>
                <p>输入需求智能回复</p>
              </div>
            </div>
            <div class="use" @click="goToPage({ path: '/chatgpt/ChatModel' })">
              <div class="sheCot">立即使用</div>
            </div>
          </div>
          <div class="divider"></div>
          <div class="dd">
            <div class="top">
              <img src="@assets/chat/huihua.png" alt="" />
              <div class="right">
                <span>AI绘画</span>
                <p>有趣得绘画视觉</p>
              </div>
            </div>
            <div class="use" @click="goToPage({ path: '/chatgpt/ChatModelDraw' })">
              <div class="sheCot">立即使用</div>
            </div>
          </div>
          <div class="divider"></div>
          <div class="dd">
            <div class="top">
              <img src="@assets/chat/yingyong.png" alt="" />
              <div class="right">
                <span>AI应用</span>
                <p>丰富得应用模板</p>
              </div>
            </div>
            <div class="use" @click="goToPage({ path: '/chatgpt/component/AuthoringTool' })">
              <div class="sheCot">立即使用</div>
            </div>
          </div>
        </div>
      </div>
      <div class="navTitle">
        <div class="h3">AI<span>应用</span></div>
        <div class="p">多种模板任您挑选，创作首选</div>
      </div>
      <authoring-tool></authoring-tool>
      <div class="navTitle" style="margin-bottom: 30px">
        <div class="h3">AI<span>聊天</span></div>
        <div class="p">帮助人们在工作和生活中获取信息和服务</div>
      </div>
      <div class="AllCont">
        <div class="contAllThree">
          <!-- <div class="AllOne">
          <div class="dt">
            <img src="@assets/chat/title-1.png" alt="" />AI工具服务
            <div class="dd">换一批</div>
          </div>
          <div class="liBox">
            <div class="ul">
              <div class="li" v-for="(item, index) in listData" :key="index" @click="goToPage(item)">
                <img :src="item.img" alt="" />
                <span>{{ item.title }}</span>
              </div>
            </div>
          </div>
        </div> -->
          <div class="AllOne AllFive">
            <div class="dt"><img src="@assets/chat/title-2.png" alt="" />你可以这样问我</div>
            <div class="question-list">
              <div class="question-item" v-for="(item, index) in listData1" :key="index">
                <div class="title">{{ item.title }}</div>
                <div class="question" v-for="(data, index) in item.content" :key="index + 'a'" @click="goToChat(data)">
                  {{ data.cont }}<img :src="item.img" alt="" />
                </div>
              </div>
            </div>
          </div>
          <div class="AllOne AllFive">
            <div class="dt"><img src="@assets/chat/title-3.png" alt="" />问答</div>
            <div class="step-list">
              <div>
                <div class="step-item" @click="goToPage({ path: '' })">
                  <img src="@assets/chat/upload.png" />
                  <div class="step-info">
                    <div class="step-title">上传文档</div>
                    <div class="step-content">建立专属业务知识文档</div>
                  </div>
                </div>
                <div class="step-arrow"><img src="@assets/chat/down.png" /></div>
              </div>
              <div>
                <div class="step-item" @click="goToPage({ path: '/chatgpt/ChatModel' })">
                  <img src="@assets/chat/jmen.png" />
                  <div class="step-info">
                    <div class="step-title">与机器人对话</div>
                    <div class="step-content">开启专业领域问答</div>
                  </div>
                </div>
                <!---->
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <global-footer />
  </div>
</template>

<script>
// import IndexChart from './IndexChart'
// import IndexTask from "./IndexTask"
// import IndexBdc from './IndexBdc'
import GlobalFooter from '@/components/page/GlobalFooter'
import { mapGetters } from 'vuex'
import LiveBroadcast from './LiveBroadcast'
import Official from './official.vue'
import AuthoringTool from '../chatgpt/component/AuthoringTool'
export default {
  name: 'Analysis',
  components: {
    LiveBroadcast,
    Official,
    AuthoringTool,
    GlobalFooter,
    // IndexChart,
    // IndexTask,
    // IndexBdc
  },
  data() {
    return {
      screenWidth: '',
      screenHeight: '',
      indexStyle: 0,
      listData: [
        {
          img: require('@assets/chat/liaotian.png'),
          title: '聊天',
          path: '/chatgpt/ChatModel',
        },
        {
          img: require('@assets/chat/huihua.png'),
          title: '绘画',
          path: '/chatgpt/ChatModelDraw',
        },
        {
          img: require('@assets/chat/caiji.png'),
          title: '文案',
          path: '/chatgpt/application/CommerceProducts',
        },
        {
          img: require('@assets/chat/zongzuojihua.png'),
          title: '工作计划',
          path: '/chatgpt/application/WorkPlan',
        },
        {
          img: require('@assets/chat/zongjiebaogao.png'),
          title: '总结报告',
          path: '/chatgpt/application/WorkPlanReprt',
        },
        {
          img: require('@assets/chat/zhoubao.png'),
          title: '周报',
          path: '/chatgpt/application/DailyWeekly',
        },
      ],
      listData1: [
        {
          img: require('@assets/chat/point.png'),
          title: '健康助手',
          content: [{ cont: '“冻了2年的羊肉还能吃吗？' }, { cont: '“寄生虫病有多可怕？”' }],
        },
        {
          img: require('@assets/chat/point.png'),
          title: '工作助手',
          content: [{ cont: '“工作怎么样安排时间？' }, { cont: '“人每天工作多少个小时最合适？”' }],
        },
      ],
      systemData: [
        {
          img: require('@assets/chat/syem-chat.jpg'),
          title: 'AI聊天',
        },
        {
          img: require('@assets/chat/syem-huihua.jpg'),
          title: 'AI绘画',
        },
        {
          img: require('@assets/chat/syem-biaoti.jpg'),
          title: '标题生成',
        },
        {
          img: require('@assets/chat/syem-goumai.jpg'),
          title: '购买评论',
        },
        {
          img: require('@assets/chat/syem-zongjie.jpg'),
          title: '总结报告',
          path: '/chatgpt/application/WorkPlan',
        },
        {
          img: require('@assets/chat/syem-wenan.jpg'),
          title: '电商文案',
        },
      ],
      navData: [],
      photoOnshow: require('@assets/chat/syem-biaoti.jpg'),
    }
  },
  created() {},
  mounted() {
    // console.log('permissionList',this.permissionList())
    // var name = this.permissionList()
    // name.forEach(item => {
    //   if(item.name === 'chatgpt'){
    //     this.navData = item.children
    //   }
    // });
    this.$nextTick(function () {
      this.screenWidth = window.innerWidth
      this.screenHeight = window.innerHeight
    })
    
  },
  methods: {
    ...mapGetters(['permissionList']),
    changePh(item, index) {
      this.indexStyle = index
      this.photoOnshow = item.img
    },
    goToChat(item) {
      var params = {
        content: item.cont,
      }
      this.$router.push({ path: '/chatgpt/ChatModel', query: { param: params } })
    },
    goToPage(item) {
      if (item.path === '') {
        this.$message.info('开发中')
      } else {
        this.$router.push({ path: item.path })
      }
    },
  },
}
</script>

<style lang="less" scoped>
.header-bgimg {
  background-image: url(../../assets/chat/indexBg.jpg);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  width: 100%;
  height: 45vw;
}
.top-model {
  .top-title {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    padding-bottom: 2%;
    color: white;
    h6 {
      font-size: 70px;
      font-weight: bold;
      letter-spacing: 10px;
      margin-bottom: 0;
      color: white;
    }
    span {
      font-size: 38px;
      font-weight: bold;
      letter-spacing: 8px;
    }
  }
  .title-list-block {
    display: flex;
    justify-content: center;
    dl {
      display: flex;
      margin: auto;
      dt {
        background: rgba(0, 0, 0, 0.3);
        width: 108px;
        height: 42px;
        border-radius: 8px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 18px;
        font-family: PingFang SC;
        font-weight: 400;
        color: #fff;
        margin: 0 10px;
        cursor: pointer;
        &.active {
          background: #938bff;
        }
      }
    }
  }
  .computer-show {
    display: flex;
    justify-content: center;
    margin-top: 2vw;
    position: relative;
    .computer-one {
      width: 60vw;
      height: 31.33333vw;
    }
    .computer-img {
      position: absolute;
      width: 47vw;
      height: 26.33333vw;
      top: 1.13333vw;
      border-radius: 0.46667vw;
    }
  }
}

.modList {
  background: white;
  background-repeat: no-repeat;
  background-size: 74.66667vw 18vw;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  margin: auto;
  padding-top: 6.66667vw;
  padding-bottom: 1.33333vw;
  .modListCot {
    width: 74.66667vw;
    display: flex;
    box-shadow: 0px 2px 6px 0px #e7e7e7;
    border-radius: 10px;
    // justify-content: space-between;
    .dd {
      padding: 40px 50px;
      width: 33%;
      cursor: pointer;
      .top {
        display: flex;
        align-items: center;
        img {
          width: 66px;
        }
        .right {
          margin-left: 20px;
          span {
            font-size: 22px;
            font-weight: bold;
            color: black;
            letter-spacing: 2px;
          }
          p {
            font-weight: bold;
            color: #bbb9b9;
            margin-top: 5px;
            letter-spacing: 1px;
          }
        }
      }
      &:hover .use .sheCot {
        transform: scale(1.05);
      }
    }
    .use {
      margin-top: 20px;
      .sheCot {
        line-height: 27px;
        color: #fff;
        background: linear-gradient(90deg, #938bff, #ff97f2);
        border-color: #938bff;
        display: inline-block;
        white-space: nowrap;
        cursor: pointer;
        -webkit-appearance: none;
        text-align: center;
        box-sizing: border-box;
        outline: 0;
        margin: 0;
        transition: all 0.3s;
        font-weight: 500;
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 8px;
        display: -ms-flexbox;
        display: flex;
        -ms-flex-align: center;
        align-items: center;
        -ms-flex-pack: center;
        justify-content: center;
        &:hover {
          opacity: 0.7;
        }
      }
    }
  }
  .divider {
    height: 6.33333vw !important;
    background-color: #f0f0f0 !important;
    display: inline-block;
    width: 1px;
    margin: 39px 8px;
    vertical-align: middle;
    position: relative;
  }
}
.contAllThree {
  .liBox {
    display: flex;
    align-content: center;
  }
  .ul {
    margin-top: 20px;
    margin-left: -1%;
    margin-right: -1%;
    .li {
      cursor: pointer;
      width: 31.33%;
      height: 150px;
      text-align: center;
      line-height: 150px;
      border-radius: 8px;
      position: relative;
      margin: 1%;
      float: left;
      .mask {
        position: absolute;
        top: 2px;
        left: 0;
        width: 100%;
        text-align: center;
        padding-top: 150px;
        border-radius: 8px;
        background-color: #000;
        opacity: 0.7;
      }
      img {
        width: 100%;
        height: 100%;
        border-radius: 9px;
      }
      span {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 80%;
        transform: translate(-50%);
        color: #cbd5e1;
        font-size: 18px;
        padding-top: 60px;
        border-radius: 8px;
        background-color: #000;
        padding: 2px 10px;
        line-height: 30px;
        margin-top: -15px;
        background: #0f121c;
        box-shadow: 0 4px 14px 0 rgba(0 0 0 / 50%);
      }
    }
    .li:nth-child(3n) {
      margin-right: 0;
    }
    .li:hover {
      opacity: 0.7;
    }
  }
}

.question-list {
  padding: 10px;
  .title {
    font-size: 14px;
    font-weight: 400;
    color: #414141;
    margin: 15px 0;
  }
  .question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f5ff;
    box-shadow: 0px 2px 6px 0px #e7e7e7;
    border-radius: 10px;
    padding: 20px 10px;
    margin: 10px 0;
    cursor: pointer;
    font-size: 16px;
    color: black;
    img {
      width: 24px;
      height: 24px;
    }
  }
}

.navTitle {
  text-align: center;
  margin-top: 30px;
  .h3 {
    font-size: 37px;
    font-weight: bold;
    color: #938bff;
    span {
      color: rgba(0, 0, 0, 0.65);
    }
  }
  .p {
    letter-spacing: 2px;
    font-size: 21px;
    color: #bbb9b9;
  }
}

.step-list {
  padding: 10px;
  img {
    width: 50px;
  }
  .step-item {
    background: #f0f5ff;
    border-radius: 10px 10px 10px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px 0;
    margin: 10px 0;
    cursor: pointer;
    .step-info {
      margin-left: 10px;
      .step-title {
        font-size: 16px;
        font-weight: 600;
        color: #414141;
        margin-bottom: 7px;
      }
      .step-content {
        font-size: 12px;
        font-weight: 400;
        color: #999999;
      }
    }
  }
  .step-arrow {
    margin: 30px 0;
    text-align: center;
    img {
      width: 50px;
    }
  }
}
/deep/.ant-tabs-nav-scroll {
  // background: white;
}
/deep/.chat-container {
  .flex {
    height: auto !important;
    .navMarginTop{
      margin-top: 0!important;
    }
  }
}

@media screen and (max-width: 767px) {
  .top-model {
    .top-title {
      padding-top: 10px;
      h6 {
        font-size: 18px;
      }
      span {
        font-size: 16px;
        letter-spacing: 4px;
        text-align: center;
      }
    }
    .title-list-block {
      dl {
        display: unset;
        dt {
          width: 70px;
          height: 31px;
          font-size: 14px;
          float: left;
          margin-bottom: 10px;
        }
      }
    }
    .computer-show {
      .computer-one {
        width: 85vw;
        height: 46.33333vw;
      }
      .computer-img {
        width: 67vw;
        height: 39.33333vw;
      }
    }
  }
  .navTitle {
    margin-top: 20px;
    .h3 {
      font-size: 25px;
    }
    .p {
      font-size: 15px;
    }
  }

  .modList {
    padding-top: 40.66667vw;
    .modListCot {
      width: 100%;
      .dd {
        padding: 10px 10px;
        display: flex;
        flex-direction: column;
        width: 30.3333333%;
        .top {
          display: unset;
          text-align: center;
          img {
            width: 33px;
            margin-bottom: 5px;
          }
        }
        .top {
          .right {
            margin-left: 5px;
            span {
              font-size: 15px;
            }
            p {
              font-size: 13px;
              margin-top: 0;
              white-space: nowrap;
              text-overflow: ellipsis;
              overflow: hidden;
            }
          }
        }
      }
      .use {
        margin-top: 0;
        .sheCot {
          line-height: 9px;
        }
      }
    }
  }


  /deep/.chat-container{
    .flex{
      margin-top: 0!important;
      width: 100%;
      
    }
  } 
}

@media screen and (max-width: 400px) {
  .modList {
    padding-top: 42.66667vw;
  }
}
@media screen and (max-width: 370px) {
  .modList {
    padding-top: 54.66667vw;
  }
}
@media screen and (max-width: 340px) {
  .modList {
    padding-top: 59.66667vw;
  }
}
</style>